package com.zn.opit.tech.easyexcel.domain.excel;

import com.alibaba.excel.annotation.ExcelProperty;
import lombok.*;

import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;

@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class BookExcelVO implements Serializable {

    @Size(max = 20, message = "书名超出20长度")
    @ExcelProperty(value = "书名")
    private String name;

    @Size(max = 10, message = "作者超出20长度")
    @ExcelProperty(value = "作者")
    private String author;

    @Pattern(regexp = "^[1-9]\\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$", message = "出版日期格式(yyyy-MM-dd)有误")
    @ExcelProperty(value = "出版日期")
    private String publishDate;
}
